#!/usr/bin/env python
# -*- coding: utf8 -*-

'''
Created on 2011-8-2

@author: zhongfeng
'''

from neweggpageparser import NewEggAllSortParser,NewEggSort3PageParser,NewEggSort4PageParser
from pageparser import ObuyUrlSummary
from spider import ObuySpider

if __name__ == '__main__':

    parserDict = {0:NewEggAllSortParser,3:NewEggSort3PageParser,4:NewEggSort4PageParser}
    
    sort3 = ObuyUrlSummary(url = ur'http://www.newegg.com.cn/SubCategory/1046.htm?pageSize=96',name='newegg',  
                                 isRecursed = True,catagoryLevel = 3)
    
    digitRoot = ObuyUrlSummary(url = ur'http://www.newegg.com.cn/SubCategory/1046-3.htm?pageSize=96', 
                               name='digital',catagoryLevel = 4)
    
    newEggRoot = ObuyUrlSummary(url = ur'http://www.newegg.com.cn/CategoryList.htm',name='newegg')

    pserver  = ObuyUrlSummary(url = ur'http://www.newegg.com.cn/Category/536.htm',
                               name='服务器',catagoryLevel = 2)
    
    spider = ObuySpider(rootUrlSummary = newEggRoot,parserDict = parserDict,include =None,exclude = None,threadNum = 5)
    spider.spide()